# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=amoco
pkgver=v2.9.11.r4.g3e36c52
pkgrel=1
epoch=1
pkgdesc='Yet another tool for analysing binaries.'
groups=('blackarch' 'blackarch-binary' 'blackarch-reversing')
arch=('any')
url='https://github.com/bdcht/amoco'
license=('GPL2')
depends=('python' 'python-pyqt5' 'python-grandalf' 'pygoocanvas' 'python-click'
         'python-crysp' 'pygtk' 'python-pytest' 'python-traitlets' 'python-tqdm'
         'python-pyparsing' 'python-blessed' 'python-z3-solver')
makedepends=('git' 'python-setuptools' 'python-pip')
source=("git+https://github.com/bdcht/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $pkgname

  sed -i 's|crysp>=1.2|crysp|g' setup.py
  sed -i 's|grandalf>=0.7|grandalf|g' setup.py
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
  cp -a doc/* "$pkgdir/usr/share/doc/$pkgname/"
}

